package com.panshi.mapper;

import com.panshi.entity.SysAnswerCheck;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 回答未审核 mapper
 */
@Mapper
public interface AnswerCheckMapper {

    /**
     * 添加未审核回答
     * @param sysAnswerCheck
     * @return
     */
    Integer addAnswer(@Param("answerCheck")SysAnswerCheck sysAnswerCheck);

    /**
     * 执行审核
     * @param sysAnswerCheck
     * @return
     */
    void adoptCheck(@Param("answerCheck")SysAnswerCheck sysAnswerCheck);


    /**
     * 根据问题id查询
     * @param answerId
     * @return
     */
    SysAnswerCheck queryInfo(@Param("answerId") Integer answerId);


    /**
     * 修改回答
     * @param sysAnswerCheck
     */
    Integer updateAnswer(@Param("answerCheck")SysAnswerCheck sysAnswerCheck);


    /**
     * 删除回答
     * @param answerId
     * @return
     */
    Integer deleteAnswer(@Param("answerId") Integer answerId);

    /**
     * 根据用户id查询
     * @param userId
     * @return
     */
    List<SysAnswerCheck> queryByUid(@Param("userId") Integer userId);

    /**
     * 判断是否重复增加回答
     * @param matterId
     * @param userId
     * @return
     */
    SysAnswerCheck isAdd(@Param("matterId") Integer matterId, @Param("userId") Integer userId);

    /**
     * 查询所有回答
     * @return
     */
    List<SysAnswerCheck> query(@Param("status") Integer status);

}
